<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Hammerspoon docs: Seal.plugins.useractions</title>
    <style type="text/css">
      a { text-decoration: none; }
      a:hover { text-decoration: underline; }
      th { background-color: #DDDDDD; vertical-align: top; padding: 3px; }
      td { width: 100%; background-color: #EEEEEE; vertical-align: top; padding: 3px; }
      table { width: 100% ; border: 1px solid #0; text-align: left; }
      section > table table td { width: 0; }
    </style>
    <link rel="stylesheet" href="docs.css" type="text/css" media="screen" />
  </head>
  <body>
    <header>
      <h1><a href="./index.html">docs</a> &raquo; Seal.plugins.useractions</h1>
      <p>Allow accessing user-defined bookmarks and arbitrary actions from Seal.</p>

      </header>
      <h3>API Overview</h3>
      <ul>
        <li>Variables - Configurable values</li>
          <ul>
            <li><a href="#actions">actions</a></li>
            <li><a href="#get_favicon">get_favicon</a></li>
          </ul>
      </ul>
      <h3>API Documentation</h3>
        <h4 class="documentation-section">Variables</h4>
          <section id="actions">
            <a name="//apple_ref/cpp/Variable/actions" class="dashAnchor"></a>
            <h5><a href="#actions">actions</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>Seal.plugins.useractions.actions</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td></td>
              </tr>
              <tr>
                  <th>Notes</th>
                  <td><ul>
<li>A table containing the definitions of static user-defined actions. Each entry is indexed by the name of the entry as it will be shown in the chooser. Its value is a table which can have the following keys (one of <code>fn</code> or <code>url</code> is required. If both are provided, <code>url</code> is ignored):</li>
<li>fn - A function which will be called when the entry is selected. The function receives no arguments.</li>
<li>url - A URL which will be opened when the entry is selected. Can also be non-HTTP URLs, such as <code>mailto:</code> or other app-specific URLs.</li>
<li>description - (optional) A string or <code>hs.styledtext</code> object that will be shown underneath the main text of the choice.</li>
<li>icon - (optional) An <code>hs.image</code> object that will be shown next to the entry in the chooser. If not provided, <code>Seal.plugins.useractions.default_icon</code> is used. For <code>url</code> bookmarks, it can be set to <code>&quot;favicon&quot;</code> to fetch and use the website's favicon.</li>
<li>keyword - (optional) A command by which this action will be invoked, effectively turning it into a Seal command. Any arguments passed to the command will be handled as follows:<ul>
<li>For <code>fn</code> actions, passed as an argument to the function</li>
<li>For <code>url</code> actions, substituted into the URL, taking the place of any occurrences of <code>${query}</code>.</li>
</ul>
</li>
<li>hotkey - (optional) A hotkey specification in the form <code>{ modifiers, key }</code> by which this action can be invoked.</li>
<li>Example configuration:</li>
</ul>

<pre><code>spoon.Seal:loadPlugins({&quot;useractions&quot;})
spoon.Seal.plugins.useractions.actions =
   {
      [&quot;Hammerspoon docs webpage&quot;] = {
         url = &quot;http://hammerspoon.org/docs/&quot;,
         icon = hs.image.imageFromName(hs.image.systemImageNames.ApplicationIcon),
         description = &quot;Open Hammerspoon documentation&quot;,
         hotkey = { hyper, &quot;h&quot; },
      },
      [&quot;Leave corpnet&quot;] = {
         fn = function()
            spoon.WiFiTransitions:processTransition('foo', 'corpnet01')
         end,
      },
      [&quot;Arrive in corpnet&quot;] = {
         fn = function()
            spoon.WiFiTransitions:processTransition('corpnet01', 'foo')
         end,
      },
      [&quot;Translate using Leo&quot;] = {
         url = &quot;http://dict.leo.org/ende/index_de.html#/search=${query}&quot;,
         icon = 'favicon',
         keyword = &quot;leo&quot;,
      },
      [&quot;Tell me something&quot;] = {
         keyword = &quot;tellme&quot;,
         fn = function(str) hs.alert.show(str) end,
      }
</code></pre>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/Seal.spoon/seal_useractions.lua#L12">Source/Seal.spoon/seal_useractions.lua line 12</a></td>
              </tr>
            </table>
          </section>
          <section id="get_favicon">
            <a name="//apple_ref/cpp/Variable/get_favicon" class="dashAnchor"></a>
            <h5><a href="#get_favicon">get_favicon</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>Seal.plugins.useractions.get_favicon</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td></td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/Seal.spoon/seal_useractions.lua#L58">Source/Seal.spoon/seal_useractions.lua line 58</a></td>
              </tr>
            </table>
          </section>
  </body>
</html>